<% include("/common/admin_header.html", {active : 'pic'}){} %>
<!--装载文件-->
<link rel="stylesheet" type="text/css" href="${cdn}/assets/js/validator-0.7.3/jquery.validator.css">

<form id="upload_pic_form" action="##" class="form-horizontal" role="form" method="post" autocomplete="off" style="margin-bottom: 100px;">
	<legend>发布图库</legend>
	<div class="form-group">
		<label class="col-md-2 control-label">添加图片：</label>
		<div class="col-md-4">
			<button type="button" id="uploader" class="btn btn-primary">选择图片</button>
		</div>
	</div>
	<div id="file-list">
		<%for(picMap in picture.pics!){%>
			<div class="form-group">
				<label class="col-md-2 control-label">新图片：</label>
				<div class="col-md-10">
					<div class="pull-left">
						<img class="img-circle" width="90" height="90" src="${picMap.url!}" />
					</div>
					<div class="pull-left imginfo">
						<textarea isold="1" savepath="${picMap.key!}" maxlength="100" onKeyDown="if (this.value.length>=100){event.returnValue=false}" name="desc" rows="3" cols="80" class="form-control" placeholder="描述，不超过100字">${picMap.desc!}</textarea>
					</div>
					<div class="pull-left">
						&nbsp;&nbsp;<button type="button" class="btn" onclick="$unique.admin.pic.delpic(this);">删除</button>
					</div>
				</div>
			</div>
		<%}%>
	</div>
	<div class="form-group">
		<label class="col-md-2 control-label">标题（可不填）：</label>
		<div class="col-md-4">
			<input type="text" name="title" placeholder="请输入标题" class="form-control" value="${picture.title!}">
		</div>
	</div>
	<div class="form-group">
		<label class="col-md-2 control-label">分享感言（可不填）：</label>
		<div class="col-md-8">
		    <script id="introduce" name="introduce" type="text/plain">${picture.introduce!}</script>
		</div>
	</div>
	
	<div id="publish"　class="form-group">
		<div class="col-md-offset-2 col-md-10">
			<input type="button" class="btn btn-primary disabled" onclick="$unique.admin.pic.publish(1);" value="发布" data-loading="请稍候...">
			<%if('' != picture.id!){%>
				<a class="btn" href="${base}/pictures/${picture.id!}" target="_blank">预览</a>
			<%}%>
			<input type="button" class="btn disabled" onclick="$unique.admin.pic.publish(2);" value="保存草稿" data-loading="请稍候...">
			<input type="hidden" name="step" value="submit">
			<input type="hidden" name="cover" value="${picture.cover!}">
			<input type="hidden" name="id" value="${picture.id!}">
			<input type="hidden" name="pics" id="picinput">
			<input type="hidden" name="status" id="picstatus">
		</div>
	</div>
</form>
<script type="text/javascript" src="${cdn}/assets/plugins/plupload/js/plupload.full.min.js"></script>
<script type="text/javascript" src="${cdn}/assets/js/jq/json2.min.js"></script>
<script type="text/javascript" src="${cdn}/assets/ueditor/ueditor.config.js"></script>
<script type="text/javascript" src="${cdn}/assets/ueditor/ueditor.all.min.js"></script>
<% include("/common/admin_footer.html",{jsList:['admin/edit_pic.js']}){} %>
